//
//  KZTabBarItem.m
//  DuoChong
//
//  Created by 唐开江 on 14/11/24.
//  Copyright (c) 2014年 KangZhi. All rights reserved.
//

#import "KZTabBarItem.h"



@implementation KZTabBarItem

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];

        //图片居中
        self.imageView.contentMode = UIViewContentModeCenter;

        //设置文字居中
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        //设置文字颜色
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self setTitleColor:globalGreenColor forState:UIControlStateSelected];
     
        
    }
    return self;
}
- (void)setTabBarItem:(UITabBarItem *)tabBarItem
{
    _tabBarItem = tabBarItem;
    
    //设置按钮正常状态的图片
//    [self setImage:tabBarItem.image forState:UIControlStateNormal];
//    //设置选择状态的图片
//    [self setImage:tabBarItem.selectedImage forState:UIControlStateSelected];
    //设置按钮的文字
    [self setTitle:tabBarItem.title forState:UIControlStateNormal];
    
    


}



//重写setHigligted方法
- (void)setHighlighted:(BOOL)highlighted
{
    //不调用父类方法
}

@end
